
package ch.hearc.coursJava.IO.persistence.objet.exemple;

import java.io.Serializable;

public class Homme implements Serializable
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/
	/**
	 * necessaire pour serialization XML
	 */
	public Homme()
		{
		//rien
		}

	public Homme(float poids, int taille)
		{
		this.poids = poids;
		this.taille = taille;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	@Override
	public String toString()
		{
		StringBuilder builder = new StringBuilder();
		builder.append("Homme [poids=");
		builder.append(this.poids);
		builder.append(", taille=");
		builder.append(this.taille);
		builder.append("]");
		return builder.toString();
		}

	public boolean isEgal(Homme homme2)
		{
		return homme2.taille == this.taille && homme2.poids == this.poids;
		}

	/*------------------------------*\
	|*				Set				*|
	\*------------------------------*/

	public void setPoids(float poids)
		{
		this.poids = poids;
		}

	public void setTaille(int taille)
		{
		this.taille = taille;
		}

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/

	public float getPoids()
		{
		return this.poids;
		}

	public int getTaille()
		{
		return this.taille;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	private float poids;
	private int taille;
	}
